<template>
	<view>

		<music-comp v-if="mode">
			<button class="switch" @click="mode = !mode">音乐</button>
		</music-comp>

		<vedio-comp v-else :searchValue="searchVal" :isAutoSea="isAuto">
			<button class="switch"   @click="mode = !mode">动漫</button>
		</vedio-comp>

		<!-- <uni-search-bar radius="100" v-model="searchValue" @confirm="comfirmSearch()"></uni-search-bar> -->
	</view>
</template>

<script>
	import musicComp from "@/components/musicComp/musicComp.vue";
	import vedioComp from "@/components/vedioComp/vedioComp.vue"
	export default {
		components: {
			vedioComp,
			musicComp,
		},
		data() {
			return {
				mode: 0 ,// 'anime' or 'music'
				searchVal:"",
				isAuto:false
			}
		},
		onLoad: function (option) { //option为object类型，会序列化上个页面传递的参数
		        this.searchVal = option.val
				this.isAuto = option.auto == 'true' 
				console.log( this.searchVal)
				console.log(this.isAuto)
		    },
		methods: {},
	}
</script>

<style>
	.switch { 
	    width: 120rpx;
	    height: 70rpx;
	    border: #DCDFE6;
	    margin-left: 10rpx;
	    font-size: 0.9em;
	    padding: 10rpx;
	    line-height: 25px;
	}
</style>
